The present invention relates to a sound data transfer method, a sound data transfer apparatus, and a program thereof for generating musical sounds, voices, and any other sounds based on reading of waveform data from a relatively low-speed storage medium such as a hard disk, which has a relatively slow access rate to stored data. More particularly, the present invention relates to generation or synthesis of waveforms which faithfully express a timbre of musical sound in response to performer""s various performance styles or articulation characteristic of natural musical instruments. The present invention is widely applicable to not only electronic musical instruments, but also devices, apparatuses or methods in all fields having a capability of generating musical sounds, voices or any other sounds such as mechanical instruments, computers, electronic game apparatuses and other multimedia devices. In this specification, a musical sound waveform is not limited to the pure musical sense, but may include a waveform of a voice or any sound.
There is widely known the xe2x80x9cwaveform memory readingxe2x80x9d technology which stores waveform data (i.e., waveform sample data) encoded with any encoding system such as PCM (pulse code modulation), DPCM (differential PCM) and ADPCM (adaptive differential PCM), and which reads the stored data according to desired musical pitches to generate or synthesize a musical sound. Further, there are known various types of xe2x80x9cwaveform memory reading systemxe2x80x9d technologies. Most conventional xe2x80x9cwaveform memory reading systemxe2x80x9d technologies are used to generate a waveform of a single sound from the beginning to the end of sounding duration. One example is to store waveform data of a whole waveform of a sound from the beginning to the end of the sounding duration. Another example is to store waveform data of a partial at an attack portion of the sound with complicated changes and to store a specified loop waveform of a subsequent part at a sustain portion with little changes. In this specification, the term xe2x80x9cloop waveformxe2x80x9d signifies a waveform which is read repeatedly in a loop.
As means for storing waveform data, there are known ROM, RAM, hard disks, CD-ROM, etc. A hard disk and CD-ROM provide a low unit price per unit storage capacity and are suited for storing a great amount of data. However, the hard disk and CD-ROM offer a slow and unstable access speed, incapable of immediately reading necessary waveform data just at the timing of outputting a musical sound signal. For this reason, the following technologies are proposed.
Japanese Patent Unexamined Publication No. Hei. 6-308964 corresponding to the U.S. Pat. No. 5,463,183 discloses the technology of preliminarily transferring to RAM a beginning portion of a plurality of waveform data stored in a hard disk. Namely, when a sounding instruction is supplied, an operation starts advance reading of a succeeding portion of the pertinent waveform data from the hard disk, and concurrently reproducing the beginning portion of the data previously stored in RAM. After the operation completes the reproduction of the beginning portion of the data, the succeeding portion of the waveform data is reproduced.
Japanese Patent Unexamined Publication No. Sho. 63-181188 discloses the technology of reproducing waveform data by sequentially reading. Waveform data to be sequentially sounded is predefined as sequence data. This technology predetermines the time to start reading of each waveform data corresponding to a sequence timing so that the start time becomes earlier than the note-on timing.
However, the technology according to Japanese Patent Unexamined Publication No. Hei. 6-308964 needs to previously transfer beginning portions of all waveform data to RAM, thereby hindering the efficient use of the precious RAM. Since the technology according to Japanese Patent Unexamined Publication No. Sho. 63-181188 is based on the assumption that a musical sound signal is generated non-realtime, it is impossible to apply this technology to a case where music sequence data is supplied realtime.
The present invention has been made in consideration of the foregoing. It is therefore a first object of the present invention to provide a sound data transfer method, a sound data transfer apparatus, and a program thereof for efficiently and extensively using RAM and for realtime generating a musical sound signal concurrently by using a hard disk etc.
The technology according to Japanese Patent Unexamined Publication No. Hei. 6-308964 needs to previously transfer beginning portions of all waveform data to RAM. The technology according to Japanese Patent Unexamined Publication No. Sho. 63-181188 always requires a hard disk to be accessed for every event, thereby increasing a noise from the hard disk and shortening the life thereof. In addition, frequent accessing of the hard disk consumes extra resources, which should be allocated to other processes.
The present invention has been made in consideration of the foregoing. It is therefore a second object of the present invention to provide a sound data transfer method, a sound data transfer apparatus, and a program thereof for decreasing unnecessary accesses to a hard disk etc.
Conventionally, the xe2x80x9cwaveform memory reading systemxe2x80x9d technology stores waveform data of a whole waveform of one sound from the beginning to the end of the sounding duration, or stores waveform data of a part of one sound as an attack portion. Such technology must store a great number of various waveform data corresponding to various playing styles (or articulations), requiring a huge storage capacity for storing these diverse waveform data.
The aforementioned system for storing waveform data of the whole waveform can faithfully express timbre variations due to various playing styles (or articulations) specific to natural musical instruments. However, such system may simply reproduce musical sounds just in accordance with the stored waveform data, providing limited controllability and editability. For example, it is very difficult to provide characteristics control such as timing axis control of waveform data corresponding to a desired playing style (or articulation) according to the musical performance data.
The present invention has been made in consideration of the foregoing. It is therefore a third object of the present invention to provide a waveform synthesis method, a sound data transfer apparatus, and a program thereof capable of easily, simply and realtime generating high-quality waveform data available for various playing styles (or articulations).
The technology according to Japanese Patent Unexamined Publication No. Hei. 6-308964 needs to previously transfer beginning portions of all waveform data of various timbres to RAM, thereby sacrificing the RAM utilization. Further, the technology according to Japanese Patent Unexamined Publication No. Sho. 63-181188 always requires a hard disk to be accessed for every event, thereby increasing a noise from the hard disk and shortening the life thereof. In addition, frequent accessing of the hard disk scarifies limited resources of a machine.
The present invention has been made in consideration of the foregoing. It is therefore a fourth object of the present invention to provide a sound data transfer method, a sound data transfer apparatus and a program thereof for saving accesses to a hard disk etc.
In order to achieve the first object, the present invention is characterized by having the following configurations. It should be noted that examples are parenthesized.
The configuration according to a first aspect of the invention is a sound data transfer method of using a low-speed storage device (hard disk 109) for storing sound data (vector data) of musical sound waveforms and a high-speed storage device (cache memory 44) for caching the sound data, and transferring a part of sound data stored in the low-speed storage device to the high-speed storage device. The method is characterized by having: a timbre specification reception process of receiving timbre specification (MIDI program change message) associated with sound data to be transferred to the high-speed storage device; a sound data prediction process (step S30) of predicting a candidate of sound data to be specified later based on the received timbre specification; and a process (step S43) for transferring the predicted sound data candidate to the high-speed storage device from the low-speed storage device.
Preferably, the sound data stored in the low-speed storage device includes first sound data corresponding to a sounding start portion (an attack portion) and second sound data corresponding to subsequent portions (a body portion) other than the sounding start portion, and sound data predicted according to the timbre specification is the first sound data. The method is characterized by further having: a first sound data specification reception process of receiving specification of any first sound data; a second sound data prediction process (step S30) of predicting a candidate of second sound data to be specified later based on the first sound data specification; and a process (step S43) for transferring the predicted second sound data to the high-speed storage device from the low-speed storage device.
Preferably, the sound data stored in the low-speed storage device further includes third sound data (a release portion or a joint portion) to be used after the first and second sound data. The method is characterized by further having: a second sound data specification reception process of receiving specification of any second sound data; a third sound data prediction process (step S33) of predicting a candidate of third sound data to be specified later based on the second sound data specification; and a process (step S43) for transferring the predicted third sound data to the high-speed storage device from the low-speed storage device.
Preferably, the inventive sound data transfer method further has a process of providing identification information (setting member dwStatus to xe2x80x98USEDxe2x80x99) which is kept in the high-speed storage device upon receipt of any of the sound data specifications and indicates possibility of releasing a candidate of sound data with failed prediction.
Preferably, the inventive sound data transfer method further has a process of previously transferring basic sound data (substitutive page) to the high-speed storage device for every timbre prior to the timbre specification reception process. When sound data specified in the first, second, or third data specification reception process is not transferred to the high-speed storage device, the basic sound data is used instead of the specified sound data.
In order to achieve the aforementioned second object, the present invention is characterized by having the following configurations. It should be noted that examples are parenthesized.
The configuration according to a second aspect of the invention is a sound data transfer method of using a low-speed storage device (hard disk 109) for storing sound data (vector data) of musical sound waveforms and a high-speed storage device (cache memory 44) for caching the sound data, and transferring s part of the sound data stored in the low-speed storage device to the high-speed storage device for waveform synthesis. The method is characterized by having: a preparation process of preparing sound data determined to be used or predicted to be used (supplying a vector ID or a packet from a prediction control section 41 or a playing style synthesis section 101C to a prefetch section 42); a synthesis start instruction process of instructing to start synthesis by using sound data which is previously instructed for preparation and is stored in the high-speed storage device; a transfer process (steps S42 an S43) of, when the sound data instructed for preparation is not stored in the high-speed storage device, transferring the sound data to the high-speed storage device from the low-speed storage device and setting a count value (member dwCount) to an initial value corresponding to the transferred sound data; an increment process of, when the sound data instructed for preparation is already stored in the high-speed storage device, incrementing a count value (member dwCount) for the sound data; a waveform synthesis process of starting waveform synthesis by using the sound data according to the start instruction from the synthesis start instruction process and decrementing (FILLED state: prefetch at S64) a count value (member dwCount) associated with the used sound data; and a setup process of detecting sound data which is stored in the high-speed storage device and which is not scheduled to be used for a subsequent start instruction based on a count value corresponding to each sound data, and setting the detected sound data to an erasable state (shifting the FILLED state S64 to the USED state S63 when the member dwCount reaches xe2x80x9c0xe2x80x9d).
Preferably, the inventive sound data transfer method is characterized by further having a prefetch process of prefetching event data from an event sequence (musical performance data) prior to a reproduction start time, where the preparation process determines sound data associated with a preparation instruction based on the prefetched event data, and thereby shares the transfer process among a plurality of event data for which common sound data is used.
Preferably, the inventive sound data transfer method is characterized by further having a process of setting a reproduction start time with a time lag from a time when event data is supplied. By such a manner, the preparation process can determine common sound data associated with a preparation instruction based on the sequentially supplied event data within the time lag, and thereby may share the transfer process among the plurality of event data for which the common sound data is used.
Preferably, the preparation process performs a plurality of the preparation instructions for the same sound data based on single event data; and the waveform synthesis process decrements the count value each time the sound data is used for the single event data.
In order to achieve the aforementioned third object, the present invention is characterized by having the following configurations. It should be noted that examples are parenthesized.
The configuration according to a third aspect of the invention is a waveform synthesis method characterized by having: an input process of receiving a packet stream comprising a plurality of packets including at least specification information (vector ID) about vector data stored in a low-speed storage device (hard disk 109) and timing information about waveform generation; a transfer process of transferring vector data specified by the specification information included in these packets from the low-speed storage device to a high-speed storage device, wherein the transfer process starts prior to a timing indicated by the timing information included in each packet; and a waveform synthesis process executed at the timing corresponding to the timing information in each packet for reproducing the vector data stored in the high-speed storage device and specified by each specification information in each of the packet and for synthesizing a waveform based on the reproduced vector data.
Preferably, the inventive waveform synthesis method is characterized by further comprising a process of determining whether or not vector data specified by the received packet is already stored in the high-speed storage device, wherein the transfer process is performed on the condition that specified vector data is not yet transferred to the high-speed storage device.
Preferably, the transfer process comprises: a process of determining whether or not there is a sufficient capacity for storing vector data to be newly transferred to the high-speed storage device; and a release process of, if the free capacity is insufficient, releasing a storage area of old vector data already used for waveform generation or of unused (unsuccessfully predicted) vector data so as to yield a free area (setting member dwStatus to xe2x80x98FREExe2x80x99).
In order to achieve the aforementioned fourth object, the present invention is characterized by having the following configurations. It should be noted that examples are parenthesized.
The configuration according to a fourth aspect of the invention is a sound data transfer method of using a low-speed storage device (hard disk 109) for storing sound data (vector data) of musical sound waveforms and a high-speed storage device (cache memory 44) for caching the sound data, and transferring a part of sound data stored in the low-speed storage device to the high-speed storage device for waveform synthesis. The inventive method is characterized by having: a transfer process (step S43) of transferring sound data from the low-speed storage device to the high-speed storage device based on a sounding instruction (note-on); and a retention process of retaining the sound data, after the same is used for waveform synthesis, in the high-speed storage device in a state capable of use in the future (setting member dwStatus to xe2x80x98USEDxe2x80x99).
Preferably, the transfer process transfers sound data from the low-speed storage device to the high-speed storage device in units of specified capacities (in units of memory blocks).
Preferably, the transfer process comprises: a process of detecting whether or not there is a sufficient capacity for storing sound data newly transferred to the high-speed storage device; a process of, if the free capacity is insufficient, releasing a storage area of previously retained sound data to create a free area (setting member dwStatus to xe2x80x98FREExe2x80x99); and a process of transferring sound data to be newly transferred to the free area.
Preferably, the sound data is used for waveform synthesis for each specified portion (module), and the method is characterized by further comprising: a process of arranging data management in the high-speed storage device so that sound data used at the beginning of each portion is not easily released in comparison with other sound data (a modification of adding vector data to be cached preferentially to the beginning of a linked list and inserting other vector data in the middle of the linked list).